<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>TP1-Algo: Référence de la classe TP1::Chemin</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">TP1-Algo
   &#160;<span id="projectnumber">1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Généré par Doxygen 1.8.6 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Page&#160;principale</span></a></li>
      <li><a href="namespaces.html"><span>Espaces&#160;de&#160;nommage</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Fichiers</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Liste&#160;des&#160;classes</span></a></li>
      <li><a href="functions.html"><span>Membres&#160;de&#160;classe</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_t_p1_1_1_chemin.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Fonctions membres publiques</a> &#124;
<a href="#pri-methods">Fonctions membres privées</a> &#124;
<a href="#pri-attribs">Attributs privés</a> &#124;
<a href="class_t_p1_1_1_chemin-members.html">Liste de tous les membres</a>  </div>
  <div class="headertitle">
<div class="title">Référence de la classe TP1::Chemin</div>  </div>
</div><!--header-->
<div class="contents">

<p>Classe implémentant une liste simplement chaînée de pièces représentant un chemin dans un labyrinthe.  
 <a href="class_t_p1_1_1_chemin.html#details">Plus de détails...</a></p>

<p><code>#include &lt;<a class="el" href="_chemin_8h_source.html">Chemin.h</a>&gt;</code></p>
<div class="dynheader">
Graphe de collaboration de TP1::Chemin:</div>
<div class="dyncontent">
<div class="center"><img src="class_t_p1_1_1_chemin__coll__graph.png" border="0" usemap="#_t_p1_1_1_chemin_coll__map" alt="Collaboration graph"/></div>
<map name="_t_p1_1_1_chemin_coll__map" id="_t_p1_1_1_chemin_coll__map">
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">légende</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html">NoeudChemin</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Classe interne à la classe <a class="el" href="class_t_p1_1_1_chemin.html" title="Classe implémentant une liste simplement chaînée de pièces représentant un chemin dans un labyrinthe...">Chemin</a>, noeud typique d'une liste simplement chaînée.  <a href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#details">Plus de détails...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Fonctions membres publiques</h2></td></tr>
<tr class="memitem:afef9a7aae72593d748dae8d7ce894f86"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_p1_1_1_chemin.html#afef9a7aae72593d748dae8d7ce894f86">Chemin</a> ()</td></tr>
<tr class="memdesc:afef9a7aae72593d748dae8d7ce894f86"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructeur par défaut de la classe <a class="el" href="class_t_p1_1_1_chemin.html" title="Classe implémentant une liste simplement chaînée de pièces représentant un chemin dans un labyrinthe...">Chemin</a>.  <a href="#afef9a7aae72593d748dae8d7ce894f86">Plus de détails...</a><br/></td></tr>
<tr class="separator:afef9a7aae72593d748dae8d7ce894f86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4692b607735342b10cdf8455baf4511"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_p1_1_1_chemin.html#ab4692b607735342b10cdf8455baf4511">~Chemin</a> ()</td></tr>
<tr class="memdesc:ab4692b607735342b10cdf8455baf4511"><td class="mdescLeft">&#160;</td><td class="mdescRight">Détruction de la liste, libère l'espace mémoire allouée avec la méthode _detruire.  <a href="#ab4692b607735342b10cdf8455baf4511">Plus de détails...</a><br/></td></tr>
<tr class="separator:ab4692b607735342b10cdf8455baf4511"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af44fa7f36853b09e67d3e8162b05f61d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_p1_1_1_chemin.html#af44fa7f36853b09e67d3e8162b05f61d">Chemin</a> (const <a class="el" href="class_t_p1_1_1_chemin.html">Chemin</a> &amp;)</td></tr>
<tr class="memdesc:af44fa7f36853b09e67d3e8162b05f61d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructeur de copie de la classe <a class="el" href="class_t_p1_1_1_chemin.html" title="Classe implémentant une liste simplement chaînée de pièces représentant un chemin dans un labyrinthe...">Chemin</a>.  <a href="#af44fa7f36853b09e67d3e8162b05f61d">Plus de détails...</a><br/></td></tr>
<tr class="separator:af44fa7f36853b09e67d3e8162b05f61d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5170c37eeb8a17daabc0b981b9cf8f33"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="class_t_p1_1_1_chemin.html">Chemin</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_p1_1_1_chemin.html#a5170c37eeb8a17daabc0b981b9cf8f33">operator=</a> (const <a class="el" href="class_t_p1_1_1_chemin.html">Chemin</a> &amp;source)</td></tr>
<tr class="memdesc:a5170c37eeb8a17daabc0b981b9cf8f33"><td class="mdescLeft">&#160;</td><td class="mdescRight">Opérateur d'assignation permettant de copier les données membres d'un chemin dans un autre.  <a href="#a5170c37eeb8a17daabc0b981b9cf8f33">Plus de détails...</a><br/></td></tr>
<tr class="separator:a5170c37eeb8a17daabc0b981b9cf8f33"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac82baa7378ac24d26bcb4096c60ac16"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_p1_1_1_chemin.html#aac82baa7378ac24d26bcb4096c60ac16">ajoutePiece</a> (const std::string &amp;nomPiece, int distanceDuDebut)</td></tr>
<tr class="memdesc:aac82baa7378ac24d26bcb4096c60ac16"><td class="mdescLeft">&#160;</td><td class="mdescRight">Ajoute le nom d'une pièce avec sa distance au début,.  <a href="#aac82baa7378ac24d26bcb4096c60ac16">Plus de détails...</a><br/></td></tr>
<tr class="separator:aac82baa7378ac24d26bcb4096c60ac16"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a830e30dc2bb1bae8a47a792bec69281d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_p1_1_1_chemin.html#a830e30dc2bb1bae8a47a792bec69281d">retirePiece</a> (int numPiece)</td></tr>
<tr class="memdesc:a830e30dc2bb1bae8a47a792bec69281d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Permet de supprimer une pièce à l'indice donnée en argument.  <a href="#a830e30dc2bb1bae8a47a792bec69281d">Plus de détails...</a><br/></td></tr>
<tr class="separator:a830e30dc2bb1bae8a47a792bec69281d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2e61bc1f6dcc5fce4ad7c1c292adaf8"><td class="memItemLeft" align="right" valign="top">const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_p1_1_1_chemin.html#ac2e61bc1f6dcc5fce4ad7c1c292adaf8">getNomPiece</a> () const </td></tr>
<tr class="memdesc:ac2e61bc1f6dcc5fce4ad7c1c292adaf8"><td class="mdescLeft">&#160;</td><td class="mdescRight">obtenir le nom de la pièce du début d'un chemin  <a href="#ac2e61bc1f6dcc5fce4ad7c1c292adaf8">Plus de détails...</a><br/></td></tr>
<tr class="separator:ac2e61bc1f6dcc5fce4ad7c1c292adaf8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7fffa5345ea80a73e85d8c2f4a012875"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_p1_1_1_chemin.html#a7fffa5345ea80a73e85d8c2f4a012875">getDistanceDuDebut</a> () const </td></tr>
<tr class="memdesc:a7fffa5345ea80a73e85d8c2f4a012875"><td class="mdescLeft">&#160;</td><td class="mdescRight">obtenir la distance du début de la pièce au début d'un chemin  <a href="#a7fffa5345ea80a73e85d8c2f4a012875">Plus de détails...</a><br/></td></tr>
<tr class="separator:a7fffa5345ea80a73e85d8c2f4a012875"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af12158a0e57995c18277fa3dd1ebcab6"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_p1_1_1_chemin.html#af12158a0e57995c18277fa3dd1ebcab6">getDistanceDernierePiece</a> () const </td></tr>
<tr class="memdesc:af12158a0e57995c18277fa3dd1ebcab6"><td class="mdescLeft">&#160;</td><td class="mdescRight">permet d'obtenir la distance du début de la pièce à la fin de la liste chaînée  <a href="#af12158a0e57995c18277fa3dd1ebcab6">Plus de détails...</a><br/></td></tr>
<tr class="separator:af12158a0e57995c18277fa3dd1ebcab6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4460a510916bbb62780133e3126474b4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_p1_1_1_chemin.html#a4460a510916bbb62780133e3126474b4">tailleChemin</a> () const </td></tr>
<tr class="memdesc:a4460a510916bbb62780133e3126474b4"><td class="mdescLeft">&#160;</td><td class="mdescRight">retourne le nombre de pièce qu'il y a dans le chemin  <a href="#a4460a510916bbb62780133e3126474b4">Plus de détails...</a><br/></td></tr>
<tr class="separator:a4460a510916bbb62780133e3126474b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d4758db7e75c5fe85b0ac8f056c40dc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_p1_1_1_chemin.html#a3d4758db7e75c5fe85b0ac8f056c40dc">afficheChemin</a> () const </td></tr>
<tr class="memdesc:a3d4758db7e75c5fe85b0ac8f056c40dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Affiche le chemin en console, ligne par ligne, avec le nom et la distance du début de chaque pièce.  <a href="#a3d4758db7e75c5fe85b0ac8f056c40dc">Plus de détails...</a><br/></td></tr>
<tr class="separator:a3d4758db7e75c5fe85b0ac8f056c40dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-methods"></a>
Fonctions membres privées</h2></td></tr>
<tr class="memitem:a5b4d70eb5cfe83096c124b3223cdd217"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_p1_1_1_chemin.html#a5b4d70eb5cfe83096c124b3223cdd217">_copier</a> (<a class="el" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html">NoeudChemin</a> *c)</td></tr>
<tr class="memdesc:a5b4d70eb5cfe83096c124b3223cdd217"><td class="mdescLeft">&#160;</td><td class="mdescRight">permet de faire une copie profonde d'un autre chemin dans l'objet courant  <a href="#a5b4d70eb5cfe83096c124b3223cdd217">Plus de détails...</a><br/></td></tr>
<tr class="separator:a5b4d70eb5cfe83096c124b3223cdd217"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab6c57041ac320f4c100065426b27cbb7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_p1_1_1_chemin.html#ab6c57041ac320f4c100065426b27cbb7">_detruire</a> ()</td></tr>
<tr class="memdesc:ab6c57041ac320f4c100065426b27cbb7"><td class="mdescLeft">&#160;</td><td class="mdescRight">permet de proprement détruire un objet de la classe <a class="el" href="class_t_p1_1_1_chemin.html" title="Classe implémentant une liste simplement chaînée de pièces représentant un chemin dans un labyrinthe...">Chemin</a> en libérant la mémoire  <a href="#ab6c57041ac320f4c100065426b27cbb7">Plus de détails...</a><br/></td></tr>
<tr class="separator:ab6c57041ac320f4c100065426b27cbb7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Attributs privés</h2></td></tr>
<tr class="memitem:a0717cfc010ba304ecca4a0edb9da2018"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html">NoeudChemin</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a></td></tr>
<tr class="separator:a0717cfc010ba304ecca4a0edb9da2018"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b9106a56586201aadfc02fb114ce5e9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">cpt</a></td></tr>
<tr class="separator:a4b9106a56586201aadfc02fb114ce5e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Description détaillée</h2>
<div class="textblock"><p>Classe implémentant une liste simplement chaînée de pièces représentant un chemin dans un labyrinthe. </p>

<p>Définition à la ligne <a class="el" href="_chemin_8h_source.html#l00026">26</a> du fichier <a class="el" href="_chemin_8h_source.html">Chemin.h</a>.</p>
</div><h2 class="groupheader">Documentation des constructeurs et destructeur</h2>
<a class="anchor" id="afef9a7aae72593d748dae8d7ce894f86"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TP1::Chemin::Chemin </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructeur par défaut de la classe <a class="el" href="class_t_p1_1_1_chemin.html" title="Classe implémentant une liste simplement chaînée de pièces représentant un chemin dans un labyrinthe...">Chemin</a>. </p>
<dl class="section post"><dt>Postcondition</dt><dd>la taille est 0 et il n'y a aucune pièce dans la file </dd></dl>

<p>Définition à la ligne <a class="el" href="_chemin_8cpp_source.html#l00021">21</a> du fichier <a class="el" href="_chemin_8cpp_source.html">Chemin.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    :<a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a>(NULL), <a class="code" href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">cpt</a>(0)</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    {}</div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a0717cfc010ba304ecca4a0edb9da2018"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">TP1::Chemin::debut</a></div><div class="ttdeci">NoeudChemin * debut</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00153">Chemin.h:153</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a4b9106a56586201aadfc02fb114ce5e9"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">TP1::Chemin::cpt</a></div><div class="ttdeci">int cpt</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00155">Chemin.h:155</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="ab4692b607735342b10cdf8455baf4511"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">TP1::Chemin::~Chemin </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Détruction de la liste, libère l'espace mémoire allouée avec la méthode _detruire. </p>
<dl class="section post"><dt>Postcondition</dt><dd>la mémoire est proprement libérée </dd></dl>

<p>Définition à la ligne <a class="el" href="_chemin_8cpp_source.html#l00028">28</a> du fichier <a class="el" href="_chemin_8cpp_source.html">Chemin.cpp</a>.</p>

<p>Références <a class="el" href="_chemin_8cpp_source.html#l00195">_detruire()</a>.</p>

<p>Référencé par <a class="el" href="_file_pieces_8cpp_source.html#l00024">TP1::FilePieces::~FilePieces()</a>.</p>
<div class="fragment"><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    {</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;        <a class="code" href="class_t_p1_1_1_chemin.html#ab6c57041ac320f4c100065426b27cbb7">_detruire</a>();</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    }</div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_ab6c57041ac320f4c100065426b27cbb7"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#ab6c57041ac320f4c100065426b27cbb7">TP1::Chemin::_detruire</a></div><div class="ttdeci">void _detruire()</div><div class="ttdoc">permet de proprement détruire un objet de la classe Chemin en libérant la mémoire ...</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8cpp_source.html#l00195">Chemin.cpp:195</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Voici le graphe d'appel pour cette fonction :</div>
<div class="dyncontent">
<div class="center"><img src="class_t_p1_1_1_chemin_ab4692b607735342b10cdf8455baf4511_cgraph.png" border="0" usemap="#class_t_p1_1_1_chemin_ab4692b607735342b10cdf8455baf4511_cgraph" alt=""/></div>
<map name="class_t_p1_1_1_chemin_ab4692b607735342b10cdf8455baf4511_cgraph" id="class_t_p1_1_1_chemin_ab4692b607735342b10cdf8455baf4511_cgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="af44fa7f36853b09e67d3e8162b05f61d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TP1::Chemin::Chemin </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_t_p1_1_1_chemin.html">Chemin</a> &amp;&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructeur de copie de la classe <a class="el" href="class_t_p1_1_1_chemin.html" title="Classe implémentant une liste simplement chaînée de pièces représentant un chemin dans un labyrinthe...">Chemin</a>. </p>
<dl class="section pre"><dt>Précondition</dt><dd>il y a assez de mémoire pour faire la copie </dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>l'objet courant sera une copie profonde du chemin passé en argument</dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">bad_alloc</td><td>s'il n'y a pas assez de mémoire</td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Paramètres</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">c,référence</td><td>constante sur le chemin à copier dans l'objet courant </td></tr>
  </table>
  </dd>
</dl>

<p>Définition à la ligne <a class="el" href="_chemin_8cpp_source.html#l00038">38</a> du fichier <a class="el" href="_chemin_8cpp_source.html">Chemin.cpp</a>.</p>

<p>Références <a class="el" href="_chemin_8cpp_source.html#l00215">_copier()</a>, <a class="el" href="_chemin_8h_source.html#l00155">cpt</a>, et <a class="el" href="_chemin_8h_source.html#l00153">debut</a>.</p>
<div class="fragment"><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    :<a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a>(NULL), <a class="code" href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">cpt</a>(c.cpt)</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    {</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;        <span class="comment">// on fait la copie seulement si le chemin passé en argument a au moins une pièce</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;        <span class="keywordflow">if</span>(c.cpt != 0)</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        {</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;            NoeudChemin* d = c.debut;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;            <a class="code" href="class_t_p1_1_1_chemin.html#a5b4d70eb5cfe83096c124b3223cdd217">_copier</a>(d);</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;        }</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    }</div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a0717cfc010ba304ecca4a0edb9da2018"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">TP1::Chemin::debut</a></div><div class="ttdeci">NoeudChemin * debut</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00153">Chemin.h:153</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a5b4d70eb5cfe83096c124b3223cdd217"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a5b4d70eb5cfe83096c124b3223cdd217">TP1::Chemin::_copier</a></div><div class="ttdeci">void _copier(NoeudChemin *c)</div><div class="ttdoc">permet de faire une copie profonde d&#39;un autre chemin dans l&#39;objet courant </div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8cpp_source.html#l00215">Chemin.cpp:215</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a4b9106a56586201aadfc02fb114ce5e9"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">TP1::Chemin::cpt</a></div><div class="ttdeci">int cpt</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00155">Chemin.h:155</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Voici le graphe d'appel pour cette fonction :</div>
<div class="dyncontent">
<div class="center"><img src="class_t_p1_1_1_chemin_af44fa7f36853b09e67d3e8162b05f61d_cgraph.png" border="0" usemap="#class_t_p1_1_1_chemin_af44fa7f36853b09e67d3e8162b05f61d_cgraph" alt=""/></div>
<map name="class_t_p1_1_1_chemin_af44fa7f36853b09e67d3e8162b05f61d_cgraph" id="class_t_p1_1_1_chemin_af44fa7f36853b09e67d3e8162b05f61d_cgraph">
</map>
</div>
</p>

</div>
</div>
<h2 class="groupheader">Documentation des fonctions membres</h2>
<a class="anchor" id="a5b4d70eb5cfe83096c124b3223cdd217"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void TP1::Chemin::_copier </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html">NoeudChemin</a> *&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>permet de faire une copie profonde d'un autre chemin dans l'objet courant </p>
<dl class="section pre"><dt>Précondition</dt><dd>il doit y avoir assez de mémoire pour faire la copie </dd>
<dd>
le noeud passé en argument doit pointer sur le début d'un chemin </dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>l'objet courant aura tous les éléments qui sont chaînés au noeud passé en argument</dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">bad_alloc</td><td>s'il manque de mémoire </td></tr>
  </table>
  </dd>
</dl>

<p>Définition à la ligne <a class="el" href="_chemin_8cpp_source.html#l00215">215</a> du fichier <a class="el" href="_chemin_8cpp_source.html">Chemin.cpp</a>.</p>

<p>Références <a class="el" href="_chemin_8cpp_source.html#l00195">_detruire()</a>, <a class="el" href="_chemin_8h_source.html#l00153">debut</a>, <a class="el" href="_chemin_8h_source.html#l00122">TP1::Chemin::NoeudChemin::distanceDuDebut</a>, <a class="el" href="_chemin_8h_source.html#l00120">TP1::Chemin::NoeudChemin::nomPiece</a>, et <a class="el" href="_chemin_8h_source.html#l00125">TP1::Chemin::NoeudChemin::suivant</a>.</p>

<p>Référencé par <a class="el" href="_chemin_8cpp_source.html#l00038">Chemin()</a>, et <a class="el" href="_chemin_8cpp_source.html#l00056">operator=()</a>.</p>
<div class="fragment"><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;    {</div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;        <span class="keywordflow">try</span></div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;        {</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;            <a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a> = <span class="keyword">new</span> NoeudChemin(c-&gt;nomPiece,c-&gt;distanceDuDebut,NULL);</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;            NoeudChemin * nouveau = <a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a>;</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;            <span class="keywordflow">for</span> (NoeudChemin * temp = c-&gt;suivant; temp!=NULL; temp = temp-&gt;suivant)</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;            {</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;                nouveau-&gt;<a class="code" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">suivant</a> = <span class="keyword">new</span> NoeudChemin(temp-&gt;nomPiece, temp-&gt;distanceDuDebut, NULL);</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;                nouveau = nouveau-&gt;suivant;</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;            }</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;        }</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;        <span class="keywordflow">catch</span> (std::exception&amp;)</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;        <span class="comment">//S&#39;il y a une exception, on doit libérer la mémoire déjà allouer dans le try, et relancer l&#39;exception pour la méthode qui a appelé.</span></div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;        {</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;            <a class="code" href="class_t_p1_1_1_chemin.html#ab6c57041ac320f4c100065426b27cbb7">_detruire</a>();</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;            <span class="keywordflow">throw</span>;</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;        }</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    }</div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a0717cfc010ba304ecca4a0edb9da2018"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">TP1::Chemin::debut</a></div><div class="ttdeci">NoeudChemin * debut</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00153">Chemin.h:153</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_1_1_noeud_chemin_html_a6d7363d192551a101e563f6c97135e8e"><div class="ttname"><a href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">TP1::Chemin::NoeudChemin::suivant</a></div><div class="ttdeci">NoeudChemin * suivant</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00125">Chemin.h:125</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_ab6c57041ac320f4c100065426b27cbb7"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#ab6c57041ac320f4c100065426b27cbb7">TP1::Chemin::_detruire</a></div><div class="ttdeci">void _detruire()</div><div class="ttdoc">permet de proprement détruire un objet de la classe Chemin en libérant la mémoire ...</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8cpp_source.html#l00195">Chemin.cpp:195</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Voici le graphe d'appel pour cette fonction :</div>
<div class="dyncontent">
<div class="center"><img src="class_t_p1_1_1_chemin_a5b4d70eb5cfe83096c124b3223cdd217_cgraph.png" border="0" usemap="#class_t_p1_1_1_chemin_a5b4d70eb5cfe83096c124b3223cdd217_cgraph" alt=""/></div>
<map name="class_t_p1_1_1_chemin_a5b4d70eb5cfe83096c124b3223cdd217_cgraph" id="class_t_p1_1_1_chemin_a5b4d70eb5cfe83096c124b3223cdd217_cgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ab6c57041ac320f4c100065426b27cbb7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void TP1::Chemin::_detruire </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>permet de proprement détruire un objet de la classe <a class="el" href="class_t_p1_1_1_chemin.html" title="Classe implémentant une liste simplement chaînée de pièces représentant un chemin dans un labyrinthe...">Chemin</a> en libérant la mémoire </p>

<p>Définition à la ligne <a class="el" href="_chemin_8cpp_source.html#l00195">195</a> du fichier <a class="el" href="_chemin_8cpp_source.html">Chemin.cpp</a>.</p>

<p>Références <a class="el" href="_chemin_8h_source.html#l00155">cpt</a>, <a class="el" href="_chemin_8h_source.html#l00153">debut</a>, et <a class="el" href="_chemin_8h_source.html#l00125">TP1::Chemin::NoeudChemin::suivant</a>.</p>

<p>Référencé par <a class="el" href="_chemin_8cpp_source.html#l00215">_copier()</a>, et <a class="el" href="_chemin_8cpp_source.html#l00028">~Chemin()</a>.</p>
<div class="fragment"><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;    {</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;        <span class="keywordflow">for</span>(NoeudChemin * nd = <a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a>; nd!=NULL; nd=nd-&gt;<a class="code" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">suivant</a>)</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;        {</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;            NoeudChemin * courant = <a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a>;</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;            <span class="keywordflow">while</span> (courant!=NULL)</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;            {</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;                <a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a> = <a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a>-&gt;<a class="code" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">suivant</a>;</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;                <span class="keyword">delete</span> courant;</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;                courant = <a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a>;</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;                <a class="code" href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">cpt</a>--;</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;            }</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;        }</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    }</div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a0717cfc010ba304ecca4a0edb9da2018"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">TP1::Chemin::debut</a></div><div class="ttdeci">NoeudChemin * debut</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00153">Chemin.h:153</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_1_1_noeud_chemin_html_a6d7363d192551a101e563f6c97135e8e"><div class="ttname"><a href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">TP1::Chemin::NoeudChemin::suivant</a></div><div class="ttdeci">NoeudChemin * suivant</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00125">Chemin.h:125</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a4b9106a56586201aadfc02fb114ce5e9"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">TP1::Chemin::cpt</a></div><div class="ttdeci">int cpt</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00155">Chemin.h:155</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a3d4758db7e75c5fe85b0ac8f056c40dc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TP1::Chemin::afficheChemin </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Affiche le chemin en console, ligne par ligne, avec le nom et la distance du début de chaque pièce. </p>

<p>Définition à la ligne <a class="el" href="_chemin_8cpp_source.html#l00175">175</a> du fichier <a class="el" href="_chemin_8cpp_source.html">Chemin.cpp</a>.</p>

<p>Références <a class="el" href="_chemin_8h_source.html#l00155">cpt</a>, <a class="el" href="_chemin_8h_source.html#l00153">debut</a>, <a class="el" href="_chemin_8h_source.html#l00122">TP1::Chemin::NoeudChemin::distanceDuDebut</a>, <a class="el" href="_chemin_8h_source.html#l00120">TP1::Chemin::NoeudChemin::nomPiece</a>, et <a class="el" href="_chemin_8h_source.html#l00125">TP1::Chemin::NoeudChemin::suivant</a>.</p>

<p>Référencé par <a class="el" href="_principal_8cpp_source.html#l00017">main()</a>, et <a class="el" href="_testeur_chemin_8cpp_source.html#l00035">TEST()</a>.</p>
<div class="fragment"><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    {</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;        <span class="keywordflow">if</span>(<a class="code" href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">cpt</a> == 0)</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;        {</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;            cout &lt;&lt; <span class="stringliteral">&quot;Chemin vide!&quot;</span> &lt;&lt; endl;</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;        }</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;        NoeudChemin* courant = <a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a>;</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;        cout &lt;&lt; courant-&gt;<a class="code" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a293623670d60c848095cb66092412c9e">nomPiece</a> &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; courant-&gt;distanceDuDebut &lt;&lt; endl;</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;        courant = courant-&gt;suivant;</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;        <span class="keywordflow">while</span>(courant != NULL)</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;        {</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;            cout &lt;&lt; courant-&gt;nomPiece &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; courant-&gt;distanceDuDebut &lt;&lt; endl;</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;            courant = courant-&gt;suivant;</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;        }</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    }</div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a0717cfc010ba304ecca4a0edb9da2018"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">TP1::Chemin::debut</a></div><div class="ttdeci">NoeudChemin * debut</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00153">Chemin.h:153</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_1_1_noeud_chemin_html_a293623670d60c848095cb66092412c9e"><div class="ttname"><a href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a293623670d60c848095cb66092412c9e">TP1::Chemin::NoeudChemin::nomPiece</a></div><div class="ttdeci">std::string nomPiece</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00120">Chemin.h:120</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a4b9106a56586201aadfc02fb114ce5e9"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">TP1::Chemin::cpt</a></div><div class="ttdeci">int cpt</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00155">Chemin.h:155</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="aac82baa7378ac24d26bcb4096c60ac16"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TP1::Chemin::ajoutePiece </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>nomPiece</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>distanceDuDebut</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Ajoute le nom d'une pièce avec sa distance au début,. </p>
<dl class="section pre"><dt>Précondition</dt><dd>il y a assez de mémoire pour ajouter un noeud </dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>il y aura un noeud avec le nom et la distance du début passé en argument à la fin de la chaîne</dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">bad_alloc</td><td>s'il n'y a pas assez de mémoire pour ajouter un noeud </td></tr>
  </table>
  </dd>
</dl>

<p>Définition à la ligne <a class="el" href="_chemin_8cpp_source.html#l00077">77</a> du fichier <a class="el" href="_chemin_8cpp_source.html">Chemin.cpp</a>.</p>

<p>Références <a class="el" href="_chemin_8h_source.html#l00155">cpt</a>, <a class="el" href="_chemin_8h_source.html#l00153">debut</a>, et <a class="el" href="_chemin_8h_source.html#l00125">TP1::Chemin::NoeudChemin::suivant</a>.</p>

<p>Référencé par <a class="el" href="_labyrinthe_8cpp_source.html#l00151">TP1::Labyrinthe::_trouveChemin()</a>, <a class="el" href="_labyrinthe_8cpp_source.html#l00199">TP1::Labyrinthe::_trouvePiecesAccessible()</a>, <a class="el" href="_labyrinthe_8cpp_source.html#l00125">TP1::Labyrinthe::cheminLabyrinthe()</a>, <a class="el" href="_file_pieces_8cpp_source.html#l00054">TP1::FilePieces::enfilePiece()</a>, et <a class="el" href="_testeur_chemin_8cpp_source.html#l00022">TEST()</a>.</p>
<div class="fragment"><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    {</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        <span class="comment">// cas où il n&#39;y a pas d&#39;élément dans le chemin</span></div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        <span class="keywordflow">if</span>(<a class="code" href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">cpt</a> == 0)</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        {</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;            <a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a> = <span class="keyword">new</span> NoeudChemin(nomPiece, distanceDuDebut, NULL);</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;            <a class="code" href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">cpt</a>++;</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;        }</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        <span class="comment">// cas où il y a déjà au moins un élément dans le chemin</span></div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <span class="comment">// on insère le nouveau noeud à la fin</span></div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        NoeudChemin* nouveau = <span class="keyword">new</span> NoeudChemin(nomPiece, distanceDuDebut, NULL);</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        NoeudChemin* courant = <a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a>;</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        <span class="keywordflow">while</span>(courant-&gt;suivant != 0)</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;            courant = courant-&gt;<a class="code" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">suivant</a>;</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        courant-&gt;<a class="code" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">suivant</a> = nouveau;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        <a class="code" href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">cpt</a>++;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    }</div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a0717cfc010ba304ecca4a0edb9da2018"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">TP1::Chemin::debut</a></div><div class="ttdeci">NoeudChemin * debut</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00153">Chemin.h:153</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_1_1_noeud_chemin_html_a6d7363d192551a101e563f6c97135e8e"><div class="ttname"><a href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">TP1::Chemin::NoeudChemin::suivant</a></div><div class="ttdeci">NoeudChemin * suivant</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00125">Chemin.h:125</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a4b9106a56586201aadfc02fb114ce5e9"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">TP1::Chemin::cpt</a></div><div class="ttdeci">int cpt</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00155">Chemin.h:155</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="af12158a0e57995c18277fa3dd1ebcab6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int TP1::Chemin::getDistanceDernierePiece </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>permet d'obtenir la distance du début de la pièce à la fin de la liste chaînée </p>
<dl class="section return"><dt>Renvoie</dt><dd>la distance du debut du dernier noeud de la liste </dd></dl>

<p>Définition à la ligne <a class="el" href="_chemin_8cpp_source.html#l00164">164</a> du fichier <a class="el" href="_chemin_8cpp_source.html">Chemin.cpp</a>.</p>

<p>Références <a class="el" href="_chemin_8h_source.html#l00153">debut</a>, <a class="el" href="_chemin_8h_source.html#l00122">TP1::Chemin::NoeudChemin::distanceDuDebut</a>, et <a class="el" href="_chemin_8h_source.html#l00125">TP1::Chemin::NoeudChemin::suivant</a>.</p>

<p>Référencé par <a class="el" href="_labyrinthe_8cpp_source.html#l00151">TP1::Labyrinthe::_trouveChemin()</a>, et <a class="el" href="_testeur_chemin_8cpp_source.html#l00220">TEST()</a>.</p>
<div class="fragment"><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    {</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;        NoeudChemin* temp = <a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a>;</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;        <span class="keywordflow">while</span>(temp-&gt;suivant != 0)</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;            temp = temp-&gt;<a class="code" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">suivant</a>;</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;        <span class="keywordflow">return</span> temp-&gt;<a class="code" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a20e3a2cdce3c7418ec729194ce186880">distanceDuDebut</a>;</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    }</div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a0717cfc010ba304ecca4a0edb9da2018"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">TP1::Chemin::debut</a></div><div class="ttdeci">NoeudChemin * debut</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00153">Chemin.h:153</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_1_1_noeud_chemin_html_a6d7363d192551a101e563f6c97135e8e"><div class="ttname"><a href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">TP1::Chemin::NoeudChemin::suivant</a></div><div class="ttdeci">NoeudChemin * suivant</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00125">Chemin.h:125</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_1_1_noeud_chemin_html_a20e3a2cdce3c7418ec729194ce186880"><div class="ttname"><a href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a20e3a2cdce3c7418ec729194ce186880">TP1::Chemin::NoeudChemin::distanceDuDebut</a></div><div class="ttdeci">int distanceDuDebut</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00122">Chemin.h:122</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a7fffa5345ea80a73e85d8c2f4a012875"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int TP1::Chemin::getDistanceDuDebut </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>obtenir la distance du début de la pièce au début d'un chemin </p>
<dl class="section return"><dt>Renvoie</dt><dd>la distance du debut du noeud debut </dd></dl>

<p>Définition à la ligne <a class="el" href="_chemin_8cpp_source.html#l00154">154</a> du fichier <a class="el" href="_chemin_8cpp_source.html">Chemin.cpp</a>.</p>

<p>Références <a class="el" href="_chemin_8h_source.html#l00153">debut</a>, et <a class="el" href="_chemin_8h_source.html#l00122">TP1::Chemin::NoeudChemin::distanceDuDebut</a>.</p>

<p>Référencé par <a class="el" href="_file_pieces_8cpp_source.html#l00065">TP1::FilePieces::defilePiece()</a>, et <a class="el" href="_testeur_chemin_8cpp_source.html#l00209">TEST()</a>.</p>
<div class="fragment"><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    {</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a>-&gt;<a class="code" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a20e3a2cdce3c7418ec729194ce186880">distanceDuDebut</a>;</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    }</div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a0717cfc010ba304ecca4a0edb9da2018"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">TP1::Chemin::debut</a></div><div class="ttdeci">NoeudChemin * debut</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00153">Chemin.h:153</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_1_1_noeud_chemin_html_a20e3a2cdce3c7418ec729194ce186880"><div class="ttname"><a href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a20e3a2cdce3c7418ec729194ce186880">TP1::Chemin::NoeudChemin::distanceDuDebut</a></div><div class="ttdeci">int distanceDuDebut</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00122">Chemin.h:122</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="ac2e61bc1f6dcc5fce4ad7c1c292adaf8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const string &amp; TP1::Chemin::getNomPiece </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>obtenir le nom de la pièce du début d'un chemin </p>
<dl class="section return"><dt>Renvoie</dt><dd>le nom de la piece du noeud debut </dd></dl>

<p>Définition à la ligne <a class="el" href="_chemin_8cpp_source.html#l00144">144</a> du fichier <a class="el" href="_chemin_8cpp_source.html">Chemin.cpp</a>.</p>

<p>Références <a class="el" href="_chemin_8h_source.html#l00153">debut</a>, et <a class="el" href="_chemin_8h_source.html#l00120">TP1::Chemin::NoeudChemin::nomPiece</a>.</p>

<p>Référencé par <a class="el" href="_labyrinthe_8cpp_source.html#l00151">TP1::Labyrinthe::_trouveChemin()</a>, <a class="el" href="_file_pieces_8cpp_source.html#l00065">TP1::FilePieces::defilePiece()</a>, et <a class="el" href="_testeur_chemin_8cpp_source.html#l00231">TEST()</a>.</p>
<div class="fragment"><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    {</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a>-&gt;<a class="code" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a293623670d60c848095cb66092412c9e">nomPiece</a>;</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    }</div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a0717cfc010ba304ecca4a0edb9da2018"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">TP1::Chemin::debut</a></div><div class="ttdeci">NoeudChemin * debut</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00153">Chemin.h:153</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_1_1_noeud_chemin_html_a293623670d60c848095cb66092412c9e"><div class="ttname"><a href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a293623670d60c848095cb66092412c9e">TP1::Chemin::NoeudChemin::nomPiece</a></div><div class="ttdeci">std::string nomPiece</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00120">Chemin.h:120</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a5170c37eeb8a17daabc0b981b9cf8f33"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="class_t_p1_1_1_chemin.html">Chemin</a> &amp; TP1::Chemin::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_t_p1_1_1_chemin.html">Chemin</a> &amp;&#160;</td>
          <td class="paramname"><em>source</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Opérateur d'assignation permettant de copier les données membres d'un chemin dans un autre. </p>
<dl class="section pre"><dt>Précondition</dt><dd>il y a assez de mémoire pour faire la copie </dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>les données membres de l'objet courant seront une copie profonde du chemin passé en argument</dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">bad_alloc</td><td>s'il n'y a pas assez de mémoire</td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Paramètres</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">source,référence</td><td>constante sur le chemin à copier dans l'objet courant</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Renvoie</dt><dd>une référence constante sur l'objet courant pour les assignations en cascade </dd></dl>

<p>Définition à la ligne <a class="el" href="_chemin_8cpp_source.html#l00056">56</a> du fichier <a class="el" href="_chemin_8cpp_source.html">Chemin.cpp</a>.</p>

<p>Références <a class="el" href="_chemin_8cpp_source.html#l00215">_copier()</a>, <a class="el" href="_chemin_8h_source.html#l00155">cpt</a>, et <a class="el" href="_chemin_8h_source.html#l00153">debut</a>.</p>
<div class="fragment"><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    {</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        <span class="keywordflow">if</span>(&amp;source != <span class="keyword">this</span>)</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        {</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;            <a class="code" href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">cpt</a> = source.cpt;</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;            <span class="comment">// on fait la copie seulement si le chemin passé en argument a au moins une pièce</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;            <span class="keywordflow">if</span>(source.cpt != 0)</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;            {</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;                NoeudChemin* d = source.debut;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;                <a class="code" href="class_t_p1_1_1_chemin.html#a5b4d70eb5cfe83096c124b3223cdd217">_copier</a>(d);</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;            }</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;        }</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    }</div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a5b4d70eb5cfe83096c124b3223cdd217"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a5b4d70eb5cfe83096c124b3223cdd217">TP1::Chemin::_copier</a></div><div class="ttdeci">void _copier(NoeudChemin *c)</div><div class="ttdoc">permet de faire une copie profonde d&#39;un autre chemin dans l&#39;objet courant </div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8cpp_source.html#l00215">Chemin.cpp:215</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a4b9106a56586201aadfc02fb114ce5e9"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">TP1::Chemin::cpt</a></div><div class="ttdeci">int cpt</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00155">Chemin.h:155</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Voici le graphe d'appel pour cette fonction :</div>
<div class="dyncontent">
<div class="center"><img src="class_t_p1_1_1_chemin_a5170c37eeb8a17daabc0b981b9cf8f33_cgraph.png" border="0" usemap="#class_t_p1_1_1_chemin_a5170c37eeb8a17daabc0b981b9cf8f33_cgraph" alt=""/></div>
<map name="class_t_p1_1_1_chemin_a5170c37eeb8a17daabc0b981b9cf8f33_cgraph" id="class_t_p1_1_1_chemin_a5170c37eeb8a17daabc0b981b9cf8f33_cgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a830e30dc2bb1bae8a47a792bec69281d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TP1::Chemin::retirePiece </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>numPiece</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Permet de supprimer une pièce à l'indice donnée en argument. </p>
<p>Les indices débutent à partir de 1.</p>
<dl class="section pre"><dt>Précondition</dt><dd>l'indice donné est valide (entre 1 et le nombre d'élément dans la liste) </dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>la pièce correspondante à l'indice sera proprement retiré de la liste des pièces</dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">invalide_argument</td><td>si l'indice donné est invalide</td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Paramètres</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">numPiece</td><td>représente l'indice du noeud qu'on veut supprimer. </td></tr>
  </table>
  </dd>
</dl>

<p>Définition à la ligne <a class="el" href="_chemin_8cpp_source.html#l00101">101</a> du fichier <a class="el" href="_chemin_8cpp_source.html">Chemin.cpp</a>.</p>

<p>Références <a class="el" href="_chemin_8h_source.html#l00155">cpt</a>, <a class="el" href="_chemin_8h_source.html#l00153">debut</a>, et <a class="el" href="_chemin_8h_source.html#l00125">TP1::Chemin::NoeudChemin::suivant</a>.</p>

<p>Référencé par <a class="el" href="_labyrinthe_8cpp_source.html#l00151">TP1::Labyrinthe::_trouveChemin()</a>, <a class="el" href="_file_pieces_8cpp_source.html#l00065">TP1::FilePieces::defilePiece()</a>, et <a class="el" href="_testeur_chemin_8cpp_source.html#l00035">TEST()</a>.</p>
<div class="fragment"><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    {</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        <span class="keywordflow">if</span>(numPiece &lt;= 0 || numPiece &gt; <a class="code" href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">cpt</a>)</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;            <span class="keywordflow">throw</span> invalid_argument(<span class="stringliteral">&quot;retirePiece: l&#39;indice donné est invalide.&quot;</span>);</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        NoeudChemin* courant = <a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a>;</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        <span class="comment">// cas où on veut supprimer le premier noeud</span></div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;        <span class="keywordflow">if</span>(numPiece == 1)</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;        {</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;            NoeudChemin* temp = <a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a>;</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;            <a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a> = <a class="code" href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">debut</a>-&gt;<a class="code" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">suivant</a>;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;            temp-&gt;<a class="code" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">suivant</a> = NULL;</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;            <span class="keyword">delete</span> temp;</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;            cpt--;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;        }</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        <span class="comment">// on se positionne un noeud avant celui qu&#39;on veut retirer</span></div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;        <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i != numPiece - 1; ++i)</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;        {</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;            courant = courant-&gt;<a class="code" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">suivant</a>;</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        }</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        <span class="comment">// cas où on veut retirer un noeud au milieu de la chaîne</span></div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;        NoeudChemin* temp = courant-&gt;<a class="code" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">suivant</a>;</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        courant-&gt;<a class="code" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">suivant</a> = temp-&gt;<a class="code" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">suivant</a>;</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;        temp-&gt;<a class="code" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">suivant</a> = NULL;</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;        cpt--;</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        <span class="keyword">delete</span> temp;</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    }</div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a0717cfc010ba304ecca4a0edb9da2018"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a0717cfc010ba304ecca4a0edb9da2018">TP1::Chemin::debut</a></div><div class="ttdeci">NoeudChemin * debut</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00153">Chemin.h:153</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_1_1_noeud_chemin_html_a6d7363d192551a101e563f6c97135e8e"><div class="ttname"><a href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html#a6d7363d192551a101e563f6c97135e8e">TP1::Chemin::NoeudChemin::suivant</a></div><div class="ttdeci">NoeudChemin * suivant</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00125">Chemin.h:125</a></div></div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a4b9106a56586201aadfc02fb114ce5e9"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">TP1::Chemin::cpt</a></div><div class="ttdeci">int cpt</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00155">Chemin.h:155</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a4460a510916bbb62780133e3126474b4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int TP1::Chemin::tailleChemin </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>retourne le nombre de pièce qu'il y a dans le chemin </p>
<dl class="section return"><dt>Renvoie</dt><dd>retourne le nombre de noeud dans le chemin </dd></dl>

<p>Définition à la ligne <a class="el" href="_chemin_8cpp_source.html#l00134">134</a> du fichier <a class="el" href="_chemin_8cpp_source.html">Chemin.cpp</a>.</p>

<p>Références <a class="el" href="_chemin_8h_source.html#l00155">cpt</a>.</p>

<p>Référencé par <a class="el" href="_labyrinthe_8cpp_source.html#l00151">TP1::Labyrinthe::_trouveChemin()</a>, <a class="el" href="_file_pieces_8cpp_source.html#l00065">TP1::FilePieces::defilePiece()</a>, <a class="el" href="_file_pieces_8cpp_source.html#l00087">TP1::FilePieces::estVideFile()</a>, et <a class="el" href="_testeur_chemin_8cpp_source.html#l00015">TEST()</a>.</p>
<div class="fragment"><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    {</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">cpt</a>;</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    }</div>
<div class="ttc" id="class_t_p1_1_1_chemin_html_a4b9106a56586201aadfc02fb114ce5e9"><div class="ttname"><a href="class_t_p1_1_1_chemin.html#a4b9106a56586201aadfc02fb114ce5e9">TP1::Chemin::cpt</a></div><div class="ttdeci">int cpt</div><div class="ttdef"><b>Definition:</b> <a href="_chemin_8h_source.html#l00155">Chemin.h:155</a></div></div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Documentation des données membres</h2>
<a class="anchor" id="a4b9106a56586201aadfc02fb114ce5e9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int TP1::Chemin::cpt</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>nombre de noeud dans le chemin </p>

<p>Définition à la ligne <a class="el" href="_chemin_8h_source.html#l00155">155</a> du fichier <a class="el" href="_chemin_8h_source.html">Chemin.h</a>.</p>

<p>Référencé par <a class="el" href="_chemin_8cpp_source.html#l00195">_detruire()</a>, <a class="el" href="_chemin_8cpp_source.html#l00175">afficheChemin()</a>, <a class="el" href="_chemin_8cpp_source.html#l00077">ajoutePiece()</a>, <a class="el" href="_chemin_8cpp_source.html#l00038">Chemin()</a>, <a class="el" href="_chemin_8cpp_source.html#l00056">operator=()</a>, <a class="el" href="_chemin_8cpp_source.html#l00101">retirePiece()</a>, et <a class="el" href="_chemin_8cpp_source.html#l00134">tailleChemin()</a>.</p>

</div>
</div>
<a class="anchor" id="a0717cfc010ba304ecca4a0edb9da2018"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_t_p1_1_1_chemin_1_1_noeud_chemin.html">NoeudChemin</a>* TP1::Chemin::debut</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Pointeur vers le premier noeud de la chaîne </p>

<p>Définition à la ligne <a class="el" href="_chemin_8h_source.html#l00153">153</a> du fichier <a class="el" href="_chemin_8h_source.html">Chemin.h</a>.</p>

<p>Référencé par <a class="el" href="_chemin_8cpp_source.html#l00215">_copier()</a>, <a class="el" href="_chemin_8cpp_source.html#l00195">_detruire()</a>, <a class="el" href="_chemin_8cpp_source.html#l00175">afficheChemin()</a>, <a class="el" href="_chemin_8cpp_source.html#l00077">ajoutePiece()</a>, <a class="el" href="_chemin_8cpp_source.html#l00038">Chemin()</a>, <a class="el" href="_chemin_8cpp_source.html#l00164">getDistanceDernierePiece()</a>, <a class="el" href="_chemin_8cpp_source.html#l00154">getDistanceDuDebut()</a>, <a class="el" href="_chemin_8cpp_source.html#l00144">getNomPiece()</a>, <a class="el" href="_chemin_8cpp_source.html#l00056">operator=()</a>, et <a class="el" href="_chemin_8cpp_source.html#l00101">retirePiece()</a>.</p>

</div>
</div>
<hr/>La documentation de cette classe a été générée à partir des fichiers suivants :<ul>
<li><a class="el" href="_chemin_8h_source.html">Chemin.h</a></li>
<li><a class="el" href="_chemin_8cpp_source.html">Chemin.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespace_t_p1.html">TP1</a></li><li class="navelem"><a class="el" href="class_t_p1_1_1_chemin.html">Chemin</a></li>
    <li class="footer">Généré le Dimanche 8 Juin 2014 19:37:05 pour TP1-Algo par
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
